import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

tf.reset_default_graph()
logdir='D:/log'
value=tf.Variable(0,name='value')
one=tf.constant(1)
newvalue=tf.add(value,one)
updatevalue=tf.assign(value,newvalue)

init=tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init)
    for i in range(12):
        sess.run(updatevalue)
        print(sess.run(value))
writer=tf.summary.FileWriter(logdir,tf.get_default_graph())
writer.close()




